<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>{:C('WEB_SITE_TITLE')}</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="__RES__/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <link href="__RES__/css/onepage-scroll.css" rel="stylesheet" type="text/css"/>
        <link href="__RES__/css/onepage-custom.css" rel="stylesheet" type="text/css"/>
        <link href="__RES__/css/style.css" rel="stylesheet" type="text/css"/>


        <script src="__RES__/js/jquery-1.11.1.min.js" type="text/javascript"></script>
        <script src="__RES__/js/bootstrap.min.js" type="text/javascript"></script>

        <script src="__RES__/js/jquery.onepage-scroll.min.js" type="text/javascript"></script>

        <script>
            $(document).ready(function () {
                $(".main").onepage_scroll({
                    sectionContainer: "section",
                    responsiveFallback: 600,
                    loop: true
                });
            });
        </script>

    </head>
    <body>


        <header class="navbar navbar-static-top bs-docs-nav" id="top" role="banner">
            <div class="container container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">
                        <img src="__RES__/img/brand.jpg" alt=""/>
                    </a>
                </div>
                <nav class="collapse navbar-collapse" role="navigation">
                    <ul class="nav navbar-nav">
                        <li>
                            <a href="javascript:void(0)"><b>欢迎：{$_SESSION.current_member.real_name}</b></a>
                        </li>
                        <li>
                            <a href="#" onclick="$('.main').moveTo(1);">主页 </a>
                        </li>
                        <li>
                            <a href="#" onclick="$('.main').moveTo(2);">学习文档</a>
                        </li>
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="#changePwdModal" data-toggle="modal" >修改密码</a></li>
                        <li><a href="{:U('Index/Index/saveExit')}"><i class="glyphicon glyphicon-home"></i> 安全退出</a></li>
                    </ul>
                </nav>
            </div>
        </header>


        <div class="wrapper">
            <div class="main">
                <section class="page1">
                    <div class="row topc">
                        <div class="col-md-offset-1 col-lg-5 col-md-5 col-xs-offset-1 col-sm-5 col-xs-8 col-xs-offset-2">
                            <div class="topc-img">
                                <img src="__RES__/img/slide1.png" alt=""/>
                            </div>
                        </div>
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                            <h3 class="topc-title">工程技术中心-学习中心平台</h3>
                            <ul>
                                <li><i class="glyphicon glyphicon-ok"></i> 注意</li>
                                <li><i class="glyphicon glyphicon-ok"></i> 本系统只支持IE10+, Chrome 36+, Firefox浏览器</li>
                                <li><i class="glyphicon glyphicon-ok"></i> 技术支持：自动化所</li>
                                <li><i class="glyphicon glyphicon-ok"></i> 联系邮箱: mu.you@changhong.com, ming.zeng@changhong.com</li>
                            </ul>
                        </div>
                    </div>
                </section>


                <section class="page2">
                    <div class="container"> 
                        <div class="row row-page2">

                            <div class="col-md-12">
                                <div class="col-md-3 col-xs-12 text-center">
                                    <img src="__RES__/img/product-1.png" alt="">
                                </div>    
                                <div class="col-md-9 col-xs-12">
                                    <table class="pdoc_table">
                                        <thead>
                                            <tr>
                                                <th class="text-right"><a href="{:U('PdocList/index')}">更多</a></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <volist name="pdocs" id="pdoc" mod="2">
                                            <tr>
                                                <td>
                                                    <i class="glyphicon glyphicon-star-empty"></i>
                                                    <a href="{:U('LearnPdoc/index')}?sn={$pdoc.pdoc_sn}">[{$pdoc.pdoc_catagory}] {$pdoc.pdoc_name} </a>
                                                    <if condition=" $pdoc.time_study neq '' ">
                                                        <span class="label label-default">已学习：{$pdoc.time_study|formatTimeStudy}</span>
                                                        <else />
                                                        <span class="label label-default">未学习</span>
                                                    </if>
                                                        <span style="color:#ccc">{$pdoc.pdoc_createtime|substr=0,10}</span>
                                                </td>
                                            </tr>
                                        </volist>

                                        </tbody>
                                    </table>
                                </div>
                            </div> 

                            <!-- <div class="col-md-6">
                                <div class="product-content col-md-7 col-xs-12">
                                    <h3>Artwork Creation</h3>
                                    
                                </div>
                                <div class="col-md-5 col-xs-12 text-center">
                                    <img src="__RES__/img/product-2.png" alt="">
                                </div>
                            </div>  -->
                            <!-- .col-md-6 -->


                        </div>
                    </div>
                </section>

<!--                <section class="page4">
                    <div class="page_container">
                        <img src="__RES__/img/back2.jpg" alt=""/>
                    </div>
                </section>-->
            </div>
        </div>
        
        
    <!-- Modal -->
    <div class="modal fade" id="changePwdModal" tabindex="-1" role="dialog" aria-labelledby="changePwdModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span>
                        <span class="sr-only">Close</span>
                    </button>
                    <h4 class="modal-title" id="changePwdModalLabel">修改密码</h4>
                </div>
                <div class="modal-body">

                    <form class="form-horizontal" role="form">

                        <div class="form-group">
                            <label for="pdoc_old_name" class="col-sm-2 control-label">原密码</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" id="old_pwd"></div>
                        </div>

                        <div class="form-group">
                            <label for="pdoc_name" class="col-sm-2 control-label">新密码</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" id="new_pwd" ></div>
                        </div>

                        <div class="form-group">
                            <label for="pdoc_describe" class="col-sm-2 control-label">确认密码</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" id="c_pwd" ></div>
                        </div>

                    </form>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" id="btnChangePwd" class="btn btn-primary">保存</button>
                </div>
            </div>
        </div>
    </div>

    <include file="Base:footer"/>
    
    
    <script>
        
        $(function(){
           $("#btnChangePwd").click(function(){
               var old_pwd = $("#old_pwd").val();
               var new_pwd = $("#new_pwd").val();
               var c_pwd = $("#c_pwd").val();
               
               var username = {$_SESSION.current_member.username};
               
               if( new_pwd !== c_pwd){
                   alert("两次密码不一致！");
                   return;
               }
               
               var sendData = {
                   'old_pwd' : old_pwd,
                   'new_pwd' : new_pwd,
                   'username' : username
               };
               
               $.post("{:U('Index/Index/changePwd')}", sendData).done(function(responseData){
                   if (responseData.status === 1) {
                        alert(responseData.info);
                        $('#changePwdModal').modal('hide');
                        $("#old_pwd").val("");
                        $("#new_pwd").val("");
                        $("#c_pwd").val("");
                    } else {
                        alert(responseData.info);
                    }
               });
               
           }); 
        });
        
    </script>
    </body>
</html>
